package net.lanelife.casino.caipiao.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

import net.lanelife.casino.caipiao.entity.support.UserRelationEntity;
import net.lanelife.casino.common.entity.annotation.Checked;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Type;
import org.joda.time.DateTime;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "TB_USER_BANK_CARD", indexes = { 
	@Index(name = "IDX_USER_ID", columnList = "USER_ID"),
	@Index(name = "IDX_USER_NAME", columnList = "USER_NAME"),
	@Index(name = "IDX_FLOOR", columnList = "FLOOR"),
	@Index(name = "IDX_PATH", columnList = "PATH"),
	@Index(name = "IDX_PARENT_ID", columnList = "PARENT_ID"),
	@Index(name = "IDX_PARENT_NAME", columnList = "PARENT_NAME")
})
public class UserBankCard extends UserRelationEntity<Integer> {

	private static final long serialVersionUID = 7216029214808207053L;
	
	@Checked
	@Column(name = "BANK_NAME", length = 10, nullable = false)
	private String bankName;
	
	@Checked
	@Column(name = "BRANCH_NAME", length = 20, nullable = false)
	private String branchName;
	
	@Checked
	@Column(name = "ACCOUNT_NAME", length = 10, nullable = false)
	private String accountName;
	
	@Checked
	@Column(name = "ACCOUNT_NO", length = 20, nullable = false)
	private String accountNo;
	
	@Column(name="SECURITY_TIME", nullable=false)
	@Type(type = "net.lanelife.casino.common.entity.usertype.PersistentDateTimeAsMillisLong")
	private DateTime securityTime = DateTime.now();

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public String getBranchName() {
		return branchName;
	}

	public void setBranchName(String branchName) {
		this.branchName = branchName;
	}

	public String getAccountName() {
		return accountName;
	}

	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}

	public String getAccountNo() {
		return accountNo;
	}

	public void setAccountNo(String accountNo) {
		this.accountNo = accountNo;
	}

	public DateTime getSecurityTime() {
		return securityTime;
	}

	public void setSecurityTime(DateTime securityTime) {
		this.securityTime = securityTime;
	}
	
}
